import Api from '@/api/payment/payProviders'
import i18n from "@/lang/index";
import ExportsApi from '@/api/system/exports'
const contentConfig = {
  pageName: "sys:user",
  table: {
    border: true,
    highlightCurrentRow: false,
    // 'show-summary': true
  },
  indexAction: (data) => {
    console.log("index", data)
    return new Promise((resolve, reject) => {
      Api.getList(data).then(s => {
        console.log(s)
        resolve(s)
      }).catch(e => {
        console.log(e)
        reject(e)
      })
    })
  },
  deleteAction: function (id) {
    console.log("delete", id);
    return new Promise((resolve, reject) => {
      Api.del({ id }).then(s => {
        resolve({
          code: "00000",
          data: null,
          msg: i18n.global.t("hint.7"),
        })
      }).catch(e => {
        reject(e)
      })
    });
  },
  exportAction: function (queryParams) {
    // 导出Excel文件
    return new Promise((resolve, reject) => {
      ExportsApi.add({ ...queryParams, ...{ type: 'deposit' } }).then(s => {
        resolve({
          code: "00000",
          data: null,
          msg: i18n.global.t("hint.85"),
        })
      }).catch(e => {
        reject(e)
      })
    });
  },
  pk: "id",
  toolbar: [
    "refresh",
    // "add",
    // "delete",
    // "export",
    // {
    //   name: "import",
    //   icon: "upload",
    //   text: "导入",
    //   auth: "import",
    // },
  ],
  cols: [
    { type: "selection", minWidth: 50, align: "center",fixed: "left" },
    { label: "ID", align: "center", prop: "id",minWidth:80,fixed: "left" },
    // { label: i18n.global.t("label.12"), align: "center", prop: "currency_code" },
    // { label: i18n.global.t("label.通道"), align: "center", prop: "name" },
    { label: i18n.global.t("label.24"), align: "center", prop: "name" },
    { label: 'CODE', align: "center", prop: "code" },
    { label: i18n.global.t("label.23"), align: "center", prop: "status", templet: 'custom', slotName: "status" },
    { label: i18n.global.t("label.38"), align: "center", type: "time", prop: "created_at", minWidth: 180,fixed: "right" },
    // {
    //   label: i18n.global.t("label.8"),
    //   fixed: "right",
    //   width: 180,
    //   align: "center",
    //   templet: "tool",
    //   operat: [
    //     // {
    //     //   icon: "Document",
    //     //   name: "details",
    //     //   text: "手动确认",
    //     // },
    //     "edit",
    //     "delete",
    //   ],
    // },
  ],
};

export default contentConfig;
